package com.lgj.gateway.controller;

import com.lgj.gateway.route.GateWayDynamicRoute;
import com.lgj.result.ResultBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: guangjie.liao
 * @Date: 2023/1/5 20:48
 * @Description:
 */
@Slf4j
@RestController
public class RefreshRouteController {
    @Autowired
    private GateWayDynamicRoute gateWayDynamicRoute;

    @PostMapping("/refresh")
    public ResultBody refreshRoute(){
        log.info("刷新路由。。。。");
        gateWayDynamicRoute.loadRoute();
        return ResultBody.success();
    }
}
